package com.krisyu.strategyPattern.sp2_enum;

import java.util.Scanner;

/**
 * @DATE 2022/1/7
 * @Author KrisYu
 * @Description 策略枚举的 使用场景
 */
public class Client {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        String symbol = scanner.next();
        int b = scanner.nextInt();
        for (Calculator cal : Calculator.values()) {
            if(cal.getSymbol().equals(symbol)){
                System.out.printf("计算结果为： %d %s %d = %d", a, symbol, b, cal.exec(a, b));
                break;
            }
        }
    }
}
